<p>Hello!</p>

<?php
$con = mysql_connect('localhost:3306','root');
if (!$con)
{
	die('Could not connect: ' . mysql_error());
}
else
{
	mysql_select_db('catan', $con);
	$sql = "select * from players where username = '". $_POST['username']. "'";
	$result = mysql_query($sql,$con);
	$row = mysql_fetch_array($result);
	if($row==null)
	{
		echo "Sorry, there is no user under this name <br />";
		echo "We will return to the welcome page after 3 seconds!";
		echo "<meta http-equiv='refresh' content='3; url=http://localhost/welcomePage.php'>";
	}
	else
	{
		if ($_POST['password'] == $row['Password'])
		{
			echo "WELCOME BACK " .$_POST['username']."<br />";
			echo "Your PersonID : " .$row['PersonID']."<br />";
			echo "Your Actuel Level :" .$row['Level']."<br />";
			echo "We will enter the game after 3 seconds!";
			echo "<meta http-equiv='refresh' content='3; url=http://localhost/bin-debug/die.html'>";
		}
		else
		{
			echo "Sorry, your password entered is not correct! <br />";
			echo "We will return to the welcome page after 3 seconds!";
			echo "<meta http-equiv='refresh' content='3; url=http://localhost/welcomePage.php'>";
		}
	}		
}
?>
